public class Test1 {
    public static void main(String[] args) {
        int[][] arr = {{1, 2, 3}, {4, 5, 6}};
        for (int[] row : arr) {
            for (int i = 0; i < row.length; i++) {
                if (row[i] % 2 == 0) {
                    row[i]++;
                }
                System.out.print(row[i] + " ");
            }
            System.out.println();
        }
    }
}
